package com.vesystem.vegua.modules.common.controller;


import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.vesystem.vegua.modules.common.entity.ServersMonitoring;
import com.vesystem.vegua.modules.common.service.impl.ServersMonitoringServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author hcy
 * @since 2020-12-29
 */
@RestController
@RequestMapping("servers")
public class ServersMonitoringController {

    @Autowired
    private ServersMonitoringServiceImpl serversMonitoringService;

    @PostMapping("addServersMonitoring")
    public void addServersMonitoring(@RequestBody ServersMonitoring serversMonitoring){
        serversMonitoringService.addServersMonitoring(serversMonitoring);
    }

    @PutMapping("updateServersMonitoring")
    public void updateServersMonitoring(@RequestBody ServersMonitoring serversMonitoring){
        serversMonitoringService.updateServersMonitoring(serversMonitoring);
    }

    @DeleteMapping("deleteServersMonitoringById/{id}")
    public void deleteServersMonitoringById(@PathVariable Integer id){
        serversMonitoringService.deleteServersMonitoringById(id);
    }

    @GetMapping("getAllServersInfo")
    public Page<ServersMonitoring> getAllServersInfo(Page<ServersMonitoring> page,String serverIp,String serverName ){
        return serversMonitoringService.getAllServersInfo(page,serverIp,serverName);
    }

    @GetMapping("getServersInfoById/{id}")
    public ServersMonitoring getServersInfoById(@PathVariable Integer id){
        return serversMonitoringService.getServersInfoById(id);
    }




}

